UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Md0OA38FRmqVCqFjyrMNIHj0oenMpX8OdRhr1meuC5E=' 
WHERE 
  key_id = 'ebf8b5d4e2a6f85de58eaa91e1192e078adfd084783b031736a4860c138efa60' 
  AND (
    token = 'Md0OA38FRmqVCqFjyrMNIHj0oenMpX8OdRhr1meuC5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029