UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vb0Ggc/iyRiqGV9bCrSSsebMzp8Y1F38E6/yme+F+30='
WHERE
key_id = 'd666ee441bb32c10a1a2100b38925b4c68cf2a8bf4e995efdc598ec6958ce3c4'
AND (
token = 'vb0Ggc/iyRiqGV9bCrSSsebMzp8Y1F38E6/yme+F+30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)