UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/4Wm8bsJepssq1qaHcR92B11lWtgCAL7UKjM8FERMGc='
WHERE
key_id = 'd655cd80af53ab9d7f04d903cad53d2b06370fcea40e42281065ebbe8d4caeb4'
AND (
token = '/4Wm8bsJepssq1qaHcR92B11lWtgCAL7UKjM8FERMGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)