UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DITZHTnDeAkhIV0D1lCP9Z33Dc2iTAmC2WMaG9PP9vM='
WHERE
key_id = '99ef4127a051a9b8f890680b975fee9cdd53578330b5cff32140c0b060037f7e'
AND (
token = 'DITZHTnDeAkhIV0D1lCP9Z33Dc2iTAmC2WMaG9PP9vM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)