UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OVBOAp76ok3hbwX9ixbIjS5RDTDCBbG8xe21BrDSsC0=' 
WHERE 
  key_id = '32109aae925f6a3b6c00a50eb35e0169464813ff8977c49e9e6fc00c6699e15b' 
  AND (
    token = 'OVBOAp76ok3hbwX9ixbIjS5RDTDCBbG8xe21BrDSsC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028