UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SPWUD3cKw9PF6h1kwFH/CAItankIghgBDFe9rexxvNE=' 
WHERE 
  key_id = '85ea3d62c144bb5bde5d59a47a88ae23794feb78494722c7a628e4042edef223' 
  AND (
    token = 'SPWUD3cKw9PF6h1kwFH/CAItankIghgBDFe9rexxvNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021