UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0e4wmxjNcyL4LJFcVmIB5nQkjnEnxe4Lt0vxSMs+ASI='
WHERE
key_id = '01a71c7ff10a9af36f08e518a8aefba000f1f4cba9a32acb775a35b2cfe59209'
AND (
token = '0e4wmxjNcyL4LJFcVmIB5nQkjnEnxe4Lt0vxSMs+ASI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)