UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2rU/fVO82DZJVV5VMN88XMFop4ASH9O/MGz9Lip4euI=' 
WHERE 
  key_id = '5d5d14fda36674937a4a32f0b40de45d41098c0f792cd3234f9b9f3e2bf51e96' 
  AND (
    token = '2rU/fVO82DZJVV5VMN88XMFop4ASH9O/MGz9Lip4euI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040