UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CsJP1qAq5uoWsdqyUR/J313+RsfVApu1OC/eMQrfXQg=' 
WHERE 
  key_id = 'fc87b96dcb992b06c29d7bc8335b1006c43ec957744db4ed5af9ae1616967975' 
  AND (
    token = 'CsJP1qAq5uoWsdqyUR/J313+RsfVApu1OC/eMQrfXQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034