UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Q9oJaF2wJZcE71hvdWdf1WAnZwtNKxkFLYZ9mUXjvw='
WHERE
key_id = '7f835628fbabb3553cd7721ff27c99f28f99df89714835035d4d303291b0764a'
AND (
token = '2Q9oJaF2wJZcE71hvdWdf1WAnZwtNKxkFLYZ9mUXjvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)