UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dUe5VKwrPLH3mSfsl1w0Ri5m3iY++zByE8t38EefdSw=' 
WHERE 
  key_id = '69acde2b26273ec8e6dd30bb704e762d49c544a4e8ac63da5ca9c9ab135c4e3c' 
  AND (
    token = 'dUe5VKwrPLH3mSfsl1w0Ri5m3iY++zByE8t38EefdSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018