UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WBLS1alnsDT+U50oQaR/ss7p0+xuln3PiACMvwyW/2A=' 
WHERE 
  key_id = 'bc556fd675ed0a429f2a52881db852aad8d2a5b5525ea2e0f69f5cd13778ca83' 
  AND (
    token = 'WBLS1alnsDT+U50oQaR/ss7p0+xuln3PiACMvwyW/2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036