UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k8+Ow1WYCuJ4QcSo2ABZ8otXhGx6totJ09id66OEnOk='
WHERE
key_id = 'c9f5de8d77f2761748174ec05803673af05962478dabadcd42ca08c49e81991f'
AND (
token = 'k8+Ow1WYCuJ4QcSo2ABZ8otXhGx6totJ09id66OEnOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)