UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NVI8riXs/Q/RwNbUaA/N0aISYDA4O5c7B2WQWkRinjM=' 
WHERE 
  key_id = 'c49cfdf475fc8de1e455f64c8c50939dffe3a16d7c90ed7b67eb17f0b128fce4' 
  AND (
    token = 'NVI8riXs/Q/RwNbUaA/N0aISYDA4O5c7B2WQWkRinjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038