UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9+ClK54/iBtKQB/oQulsT5Q4KsH5fWt8ay9t9waiS8='
WHERE
key_id = '73d1a502618c64c348d9855aa27a9b316a0bfca7f257c756af9498e3ac9dfd1d'
AND (
token = 's9+ClK54/iBtKQB/oQulsT5Q4KsH5fWt8ay9t9waiS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)