UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qkDUkSXrvDR9K1cGvtLSbDLSeee6WBIp/Az4CzfFQ7s='
WHERE
key_id = '453487e3f2c949503f8e3cec811de9c8c1690155a6ec02a4a367516dd56a4dac'
AND (
token = 'qkDUkSXrvDR9K1cGvtLSbDLSeee6WBIp/Az4CzfFQ7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)