UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RrwU/x29uiq1cAjMGSn1sPLwmXts2D519yoQnStz5hA='
WHERE
key_id = 'a4490f8655946fd1d6666675ac933aeef45b6f0f0d426a64cd75fe6160aec9ae'
AND (
token = 'RrwU/x29uiq1cAjMGSn1sPLwmXts2D519yoQnStz5hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)