UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sI+gOii7X8nFHjRZCe/KWRN6Oi80Dv1cHTpDL2wNHkM=' 
WHERE 
  key_id = '88ece743100b5ef7c3439ffd7e19a5f1fe924716822435e81fa15ca7924e7d1c' 
  AND (
    token = 'sI+gOii7X8nFHjRZCe/KWRN6Oi80Dv1cHTpDL2wNHkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026