UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8d5uenfsR8nYVtPU0QQ9zbDJK1bZRV+QnjTLJHpaPbs='
WHERE
key_id = 'd3453a58ca3b3db206bacbe5fd1babd1bf10d3f38f7a9c60a20fc52c12726e2c'
AND (
token = '8d5uenfsR8nYVtPU0QQ9zbDJK1bZRV+QnjTLJHpaPbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)