UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmlxLKSWALHeeqMtZ/9IXWEATCrNsJR+YeCk/++Yg+E='
WHERE
key_id = '2ea493b405d36f5259a6b31f2e8b513397e4a0d9bde4cb81e1e55b5585494fd4'
AND (
token = 'qmlxLKSWALHeeqMtZ/9IXWEATCrNsJR+YeCk/++Yg+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)