UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iYgH3Jyhk2dz3pxYZuGOziQAAfd6d7L1iRO9R3XQsmU=' 
WHERE 
  key_id = '7828e5b58cb37205f69c48da89ec8de709f0a05857d8ae01184c435fb2a19379' 
  AND (
    token = 'iYgH3Jyhk2dz3pxYZuGOziQAAfd6d7L1iRO9R3XQsmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035