UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mLzjHYohlZABYEt1QYSs9TyMRgIUXaawpZ1fHQoRfKM=' 
WHERE 
  key_id = '49fc9ab6432b8a189d4d2ce18a60abf6dfb22709ba23d68bea4e892d9e532090' 
  AND (
    token = 'mLzjHYohlZABYEt1QYSs9TyMRgIUXaawpZ1fHQoRfKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024