UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uE+35Z7j6IsdReALVc6Z44rqTplgXCgSiG421Wylg3o=' 
WHERE 
  key_id = '5a7d1ef381782a50d455a44c49baa372490440fea254a8c1edb1d7d45f45a754' 
  AND (
    token = 'uE+35Z7j6IsdReALVc6Z44rqTplgXCgSiG421Wylg3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043