UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ObqSiQpzmIrR9xgGTWFE9cgsavvYEZn4KXiDdceXw7U='
WHERE
key_id = 'a44357af4d5eb001929bbb1080b81c655d97e1cb8efd68f66f1182681db55d28'
AND (
token = 'ObqSiQpzmIrR9xgGTWFE9cgsavvYEZn4KXiDdceXw7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)