UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l73TjW36F2DCwRx51jjcAIn0ij3rhmpzyhsPMPtc5bQ=' 
WHERE 
  key_id = '95070fdd5294b3abb1e0189969cf3b3df3e7b49d8b4cbe662686a420be2c5b22' 
  AND (
    token = 'l73TjW36F2DCwRx51jjcAIn0ij3rhmpzyhsPMPtc5bQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019