UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1WmC/XgvwHaTLNakhJ8+4WnggNOLNDpVpL8dxuj99u8='
WHERE
key_id = 'e6f9cd3a6536da3b08bb1cbb9cd900fb3f985d97eaaf941e6f0aa67aa26c12fd'
AND (
token = '1WmC/XgvwHaTLNakhJ8+4WnggNOLNDpVpL8dxuj99u8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)