UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AHilC4rTwkx7cm8TWdFl8z2c5JejXmIRgFlNO7n40q0='
WHERE
key_id = '9141eef7c8c25c94f60972bf2fa535066f14da9f8cef5e80a909da58c3e0a0e4'
AND (
token = 'AHilC4rTwkx7cm8TWdFl8z2c5JejXmIRgFlNO7n40q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)