UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hcdc+zSvXb5fKpnDU9oRX8vMk/F73wf6bFeHUKTkV2Y=' 
WHERE 
  key_id = '48cd183d7f2dce30282abd39b080943d5023a26a88220aa3f80a9f771e95c95f' 
  AND (
    token = 'hcdc+zSvXb5fKpnDU9oRX8vMk/F73wf6bFeHUKTkV2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051