UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MWQL/HWCsGZu489wkLE2LylaOWEKjhzHSzhNTqSnrhQ='
WHERE
key_id = '89d38aea78fd2aebb7316541ae261e94d4fc5012e070790e077c564fc0df7a48'
AND (
token = 'MWQL/HWCsGZu489wkLE2LylaOWEKjhzHSzhNTqSnrhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)