UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOcHRYj0rzm5ECi5fd38WNwqHwjROquwCHTU+52rQsg='
WHERE
key_id = 'd5c5978baf87f9c09c77dfc605f08f547cbadb7ccf122abf7cc7863f78a6005f'
AND (
token = 'wOcHRYj0rzm5ECi5fd38WNwqHwjROquwCHTU+52rQsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)