UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AMCZoYbkq2VjzvRxt+iAgYXNRh+DKildAty/gqUrRnc='
WHERE
key_id = 'b9b45fb716fab8595aaeb344a2f54cc69d0317bd18cd8c16b5d10e7440476e4d'
AND (
token = 'AMCZoYbkq2VjzvRxt+iAgYXNRh+DKildAty/gqUrRnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)