UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F0qr8vLLvF07dUfr0nZaHbBFa4sBRU5sPwKElfETz7k=' 
WHERE 
  key_id = '6e0eaceb003c5456052aad3962e247d9bf41ea0a87fa60e99a1e260f924d2e03' 
  AND (
    token = 'F0qr8vLLvF07dUfr0nZaHbBFa4sBRU5sPwKElfETz7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021