UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Karw/nkaMClfzVecfJDxM73OKDSC03P1Hdp9mHQAcMU=' 
WHERE 
  key_id = '3e636deca892c0075cbc437b5f84a0d2330c3662ca3291e73f0bc2ab4797c254' 
  AND (
    token = 'Karw/nkaMClfzVecfJDxM73OKDSC03P1Hdp9mHQAcMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016