UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X44vrQaNkg591oifWS1GvsPiph/tulfC26MUjBH/cLc=' 
WHERE 
  key_id = 'b144cdd3cab75572bcbb303051d00424b2d1c6e20379408df510cbad612bba35' 
  AND (
    token = 'X44vrQaNkg591oifWS1GvsPiph/tulfC26MUjBH/cLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027