UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ak9cHi+ARTMiatRSOgfzh/p7Wwcu/0fasJT1swbHT1k='
WHERE
key_id = '624bb9465a1c52c71e2c38d15a0023f1d5fe8bc4fc73f9d7b9bfffa785efd067'
AND (
token = 'Ak9cHi+ARTMiatRSOgfzh/p7Wwcu/0fasJT1swbHT1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)