UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sJSssVEIW4RZDO5W2oZi73F/+eZwMKyDS4fMshnESLc=' 
WHERE 
  key_id = 'a9e0eb1574a11ed4dbeed2512129cb0be0ea28ce896f45a487059e9ed1e5f534' 
  AND (
    token = 'sJSssVEIW4RZDO5W2oZi73F/+eZwMKyDS4fMshnESLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041