UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bxwA+V5oJufL/SBPwKTpupZ4uwh9wt072Bb2xhZMBfE=' 
WHERE 
  key_id = 'e80535f74ac3eb7f8f802dce4431642d6c5ff8a5a7182f901657e7147b437efe' 
  AND (
    token = 'bxwA+V5oJufL/SBPwKTpupZ4uwh9wt072Bb2xhZMBfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048