UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ErtZzHvwxOKUtD3xjSoOWOC7ppADm211MdgAFNuPtnU='
WHERE
key_id = '0015e68ec1aa6534cb061e75ab7dfa98df2698ad237ae505f86856549cab0a55'
AND (
token = 'ErtZzHvwxOKUtD3xjSoOWOC7ppADm211MdgAFNuPtnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)