UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91N3VwsG0pk9sMrjR0hm3KNqqoznZfZM8y3I7Qjk2Iw='
WHERE
key_id = '1f91ad844722580c5961f2966ba04b010fcf28a6923da77c3265dfcd7000ee19'
AND (
token = '91N3VwsG0pk9sMrjR0hm3KNqqoznZfZM8y3I7Qjk2Iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)