UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6rlnL8y3NWFjMbXOO3MhJ3mFY9f+7T0LXmYuf5neI3g=' 
WHERE 
  key_id = '2a7d0bab58e285bb05483107fe6a70d63504c92ad14ab2db64826fef02e6e2c1' 
  AND (
    token = '6rlnL8y3NWFjMbXOO3MhJ3mFY9f+7T0LXmYuf5neI3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061