UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VKfFTnESvnADqVMuxjJLxHgFNim00dIXUSIJokzt4M=' 
WHERE 
  key_id = 'a9d66664bc57f5b938c3ba5146fcfa4e8c081a8b2dfd819f7709254270b8e20f' 
  AND (
    token = '/VKfFTnESvnADqVMuxjJLxHgFNim00dIXUSIJokzt4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017