UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzYaY7neNeOXz3wcZ8X3nHeYC2ux1pu64ulSnCdE21I='
WHERE
key_id = 'ec432c18876cfe3f3c5fb46fce463f22306f659ae202db6f55e22b5f708a8ee8'
AND (
token = 'LzYaY7neNeOXz3wcZ8X3nHeYC2ux1pu64ulSnCdE21I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)