UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mX00l7ltG5Mt8zp8h3CCTW9H3kABdCKtJJFu+4E8fKo=' 
WHERE 
  key_id = '26546de7d5909b0a809d203a2381d0d1bba23d9ecf7b50a148c07d4e58c06611' 
  AND (
    token = 'mX00l7ltG5Mt8zp8h3CCTW9H3kABdCKtJJFu+4E8fKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022