UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aJNYvculTjKOuU9G+1hkvbEh7pV5gkQ5djXfVSOHLuc=' 
WHERE 
  key_id = '74fd0326b577ac32e1d0833bdc9011c2eaa49ac26b2f32f59fa40e80d2db48d0' 
  AND (
    token = 'aJNYvculTjKOuU9G+1hkvbEh7pV5gkQ5djXfVSOHLuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031