UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkPfm5/3nDaWjJ5ohM9b9Z7M26Ha6hgHk1wPWCGAGFg=' 
WHERE 
  key_id = '09c5fa3f5cad28655f39ed3a3f4437ccfddbd23e514c9359a3b5bd4958d7d73b' 
  AND (
    token = 'pkPfm5/3nDaWjJ5ohM9b9Z7M26Ha6hgHk1wPWCGAGFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033