UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nDn8LfAzAG93x1c4yR8jcp1wlX9TLhROfXwIOZjQQkw='
WHERE
key_id = '0867dd35cb61871e9029063cf0cb11d39ae7afebb27d260fc92ea375e7971179'
AND (
token = 'nDn8LfAzAG93x1c4yR8jcp1wlX9TLhROfXwIOZjQQkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)