UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GvOPQk1cUjGHdMKkdtoYZpkVUtQVMXuNUPMcmxL3FTc=' 
WHERE 
  key_id = '56458e7cb09bf8ff03f6ea078c324432f25316e74915f62829b5f75f9e87a41d' 
  AND (
    token = 'GvOPQk1cUjGHdMKkdtoYZpkVUtQVMXuNUPMcmxL3FTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016