UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GSeChzHnPnRrKnSFOYIRMMtj0ypVS2NXj2yCvkHR/Kk='
WHERE
key_id = '18cc593671b996d69b5fd79c063cc2d7c2f7e9b823706bb79d3d6c2c826d5188'
AND (
token = 'GSeChzHnPnRrKnSFOYIRMMtj0ypVS2NXj2yCvkHR/Kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)