UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '69tXQdBUrHuzI8i5xgByY1wSVJMYe/wdnQokFS0HZwA=' 
WHERE 
  key_id = '9ff0366c77f95bc00558daf7e8a4854a0ce98483a4b2343c80218bf23b7801be' 
  AND (
    token = '69tXQdBUrHuzI8i5xgByY1wSVJMYe/wdnQokFS0HZwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016