UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SL025vcK7zOYrUAF8RakaH0oeQWG8yNZdWv8Bpq7rmI='
WHERE
key_id = '16ec628c3a2b5205151dba3d46907e7cd0056cb0738fe739ae46377a10359585'
AND (
token = 'SL025vcK7zOYrUAF8RakaH0oeQWG8yNZdWv8Bpq7rmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)