UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PV0uuGsNoGSKuuC05ttVReq73sFUEaaM/AR1qgyYLZE=' 
WHERE 
  key_id = '18dc4187640c2f71e798b1667600bf69f8ff8ef4ab5a1e1b50efa50d6b8e68b1' 
  AND (
    token = 'PV0uuGsNoGSKuuC05ttVReq73sFUEaaM/AR1qgyYLZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020