UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T9nKHUTvcNrvYE8gMaOQcjDDFMg2UfTOdA3P43UPlY0='
WHERE
key_id = '28f11972bbd7c9129e5f621bfc4278a4430ebeb9ba3960c29f2804b1ed3645ac'
AND (
token = 'T9nKHUTvcNrvYE8gMaOQcjDDFMg2UfTOdA3P43UPlY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)