UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hzSci+MHcJTdzvPwrl8J+zAbASGBlY/aR88xe/sskXQ=' 
WHERE 
  key_id = '4819117c83c8d24482224378a49e0c0dc3b1b666b6a5fbb8c815705016c92732' 
  AND (
    token = 'hzSci+MHcJTdzvPwrl8J+zAbASGBlY/aR88xe/sskXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032